import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';

@Entity('user')
export class User {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ unique: true })
  userId: string;

  @Column()
  password: string;

  @Column()
  nickName: string;

  @Column()
  avatar: string;

  @Column({ nullable: true })
  wechatId?: string;

  @Column({ nullable: true })
  phone?: string;

  @Column('text', { nullable: true })
  note?: string;

  @Column({ type: 'enum', enum: ["0", "1", "2", " 3", "4", "5"], default: "0" })
  member: string;

  @Column({ type: 'enum', enum: ["0", "1", "2", " 3", "4", "5"], default: "1 " })
  status: string; // 记录的状态 notnull 默认值为1

  @Column()
  platform: string;

  @CreateDateColumn()
  createdDate: Date;
}